/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.PropertiesConfiguration;

/**
 *
 * @author smashing
 */
public class Config {
    
    private static Config instance = null;
    private Configuration configuracao = null;
    
    private Config() {
        try {
            configuracao = new PropertiesConfiguration("config.properties");
        } catch (Exception ex) {
            Logger.getLogger(Config.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public static Config getInstance() {
        if(instance == null) {
            instance = new Config();
        }
        return instance;
    }
    
    public String getString(String key) {
        return configuracao.getString(key);
    }
    
    public int getInt(String key) {
        return configuracao.getInt(key);
    }
    
}
